/*
 Template Name: Xacton - Admin & Dashboard Template
 Author: Myra Studio
 File: Dashboard
*/

$(function() {
  'use strict';

 if ($("#morris-donut-example").length) {
    Morris.Donut({
      element: 'morris-donut-example',
      resize: true,
      colors: ['#e9ecef', '#1d84c6'],
      
      data: [
        {
          label: "未使用",
          value: 80
        },
        {
          label: "C盘",
          value: 20
        }
      ]
    });
  }

  if ($('#morris-line-example').length) {
    Morris.Line({
      element: 'morris-line-example',
      gridLineColor: '#eef0f2',
      lineColors: ['#f15050', '#e9ecef'],
      data: [{
          y: '2013',
          x: 1.1
        },
        {
          y: '2014',
          x: 0.8
        },
        {
          y: '2015',
          x: 1.2
        },
        {
          y: '2016',
          x: 1
        },
        {
          y: '2017',
          x: 0.7
        },
        {
          y: '2018',
          x: 1
        },
        {
          y: '2019',
          x: 1.4
        }
      ],
      xkey: 'y',
      ykeys: 'x',
      hideHover: 'auto',
      resize: true
    });
  }
});

$(function () {
  $('[data-plugin="knob"]').knob({
    'draw' : function () { 
      $(this.i).val(this.cv + '%')
    }
  });
});